package cn.westv.scps.domain;

import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;

/**
 * Created by Administrator on 2017/10/16.
 */
@Entity(name = "app_version")
public class AppVersionEntity {
    private String id;
    private Date publishTime;
    private String versionNo;
    private String content;
    private String subscribe;
    private String url;
    private String appType;
    private String isForce;

    public static final String APP_TYPE_OWNER = "1";
    public static final String APP_TYPE_FAKA = "2";

    public static final String IS_FORCE_TRUE = "1";
    public static final String IS_FORCE_FALSE = "0";

    @Id
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "PUBLISH_TIME")
    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    @Basic
    @Column(name = "VERSION_NO")
    public String getVersionNo() {
        return versionNo;
    }

    public void setVersionNo(String versionNo) {
        this.versionNo = versionNo;
    }

    @Basic
    @Column(name = "CONTENT")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "SUBSCRIBE")
    public String getSubscribe() {
        return subscribe;
    }

    public void setSubscribe(String subscribe) {
        this.subscribe = subscribe;
    }

    @Basic
    @Column(name = "URL")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "APP_TYPE")
    public String getAppType() {
        return appType;
    }

    public void setAppType(String appType) {
        this.appType = appType;
    }


    @Basic
    @Column(name = "IS_FORCE")
    public String getIsForce() {
        return isForce;
    }

    public void setIsForce(String isForce) {
        this.isForce = isForce;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AppVersionEntity that = (AppVersionEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (publishTime != null ? !publishTime.equals(that.publishTime) : that.publishTime != null) return false;
        if (versionNo != null ? !versionNo.equals(that.versionNo) : that.versionNo != null) return false;
        if (content != null ? !content.equals(that.content) : that.content != null) return false;
        if (subscribe != null ? !subscribe.equals(that.subscribe) : that.subscribe != null) return false;
        if (url != null ? !url.equals(that.url) : that.url != null) return false;
        if (appType != null ? !appType.equals(that.appType) : that.appType != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (publishTime != null ? publishTime.hashCode() : 0);
        result = 31 * result + (versionNo != null ? versionNo.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (subscribe != null ? subscribe.hashCode() : 0);
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (appType != null ? appType.hashCode() : 0);
        return result;
    }
}
